<?php

/**
 * Class representation of the HTML <input type="submit" /> tag. It can be added to containers.
 *
 * @author Herjan Treurniet
 * @since 2008-09-13
 * @package Form.Elements
 */
class InlineFrame extends FormElement {

	function __construct( $name, $url, $properties ) {
		$properties[ 'url' ] = $url;
		parent::__construct( $name, $properties );
	}

	public function __toString( ) {
		$html = '';

		foreach ( $this->properties as $key => $property ) {
			if ( substr ( $key, 0, 5 ) == 'html_' ) {
				$html .= ' '.substr ( $key, 5 ).'="'.$property.'"';
			}
		}

		return '
		<label>'.$this->getProperty( 'label' ).'</label>
		<iframe src="'.$this->getProperty( 'url' ).'" id="' . $this->name . '"'.$html.'></iframe>';
	}
}

?>